<?php
/**
 * Author:xsc
 * Time:2023/8/30 20:20
 */

namespace App\Http\Controllers\Common;

use App\Http\Controllers\BaseController;
use App\Params\Common\MerchantsInfoCreateParams;
use App\Params\Common\MerchantsInfoSaveParams;
use App\Params\Common\MerchantsParams;
use App\Service\Common\MerchantsService;

class MerchantsController extends BaseController
{

    /**
     * 查询创作者信息
     * @return \Illuminate\Http\JsonResponse
     * @throws \App\Exceptions\BusinessException
     * Author:xsc
     * Time:2023/9/4 19:15
     */
    public function info()
    {
        $params = MerchantsParams::create();
        $data = MerchantsService::getInstance()->getInfo($params);
        return $this->success($data);
    }

    /***
     * 查询创作者全部藏品
     * @return \Illuminate\Http\JsonResponse
     * @throws \App\Exceptions\BusinessException
     * Author:xsc
     * Time:2023/9/4 19:17
     */
    public function specialList()
    {
        $params = MerchantsParams::create();
        $data = MerchantsService::getInstance()->getSpecialList($params);
        return $this->success($data);
    }

    /**
     * 创作者入驻申请
     * @return \Illuminate\Http\JsonResponse
     * @throws \App\Exceptions\BusinessException
     * @author shen.zk
     * @date 2023-10-23 17:55
     */
    public function merchantInfoCreate()
    {
        $params = MerchantsInfoCreateParams::create();
        $data = MerchantsService::getInstance()->merchantInfoCreateService($params);
        return $this->success($data);
    }

    /**
     * 创作者入驻编辑
     * @return \Illuminate\Http\JsonResponse
     * @throws \App\Exceptions\BusinessException
     * @author shen.zk
     * @date 2023-10-24 18:03
     */
    public function merchantInfoSave()
    {
        $params = MerchantsInfoSaveParams::create();
        $data = MerchantsService::getInstance()->merchantInfoSaveService($params);
        return $this->success($data);
    }

    /**
     * 申请流水号获取审核信息
     * @return \Illuminate\Http\JsonResponse
     * @throws \App\Exceptions\BusinessException
     * @author shen.zk
     * @date 2023-10-24 18:33
     */
    public function getApplyForInfo()
    {
        $data = MerchantsService::getInstance()->getApplyForInfoService();
        return $this->success($data);
    }
}
